<%@ page pageEncoding="UTF-8" language="java" errorPage="/error.jsp"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>学习系统-登录</title>
		<link rel="stylesheet" type="text/css" media="all" href="<c:url value='/styles/login.css'/>" />
	</head>
	<%
		String fromUrl = request.getParameter("from");
		if(fromUrl == null){
			fromUrl = "";
		}
	%>
	<body>
		<form method="post" action="<c:url value='/adminAuth'/>" id="loginForm" onsubmit="return validateForm(this);">
		    <input type="hidden" name="from" value="<%=fromUrl %>">
			<table width="919" border="0" align="center" cellpadding="0" cellspacing="0">
				<tr>
					<td>
						<img src="${ctx}/images/login-logo.png" width="919" height="153">
					</td>
				</tr>
				<tr>
					<td height="170" valign="top" background="${ctx}/images/login-header.jpg">
						<table width="919" border="0" cellspacing="0" cellpadding="2">
							<tr>
								<td width="446">
									&nbsp;
								</td>
								<td width="382">
									<table width="382" border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td width="382" height="77" align="left" valign="top">
												<img src="${ctx}/images/login-title.png" width="380" height="63">
											</td>
										</tr>
										<tr>
											<td valign="top">
												<table width="382" border="0" cellspacing="0"
													cellpadding="0">
													<tr>
														<td width="267">
															<table width="267" border="0" cellspacing="0"
																cellpadding="0">
																<tr>
																	<td width="90" height="35" align="center"
																		class="ziti-12-lanse">
																		用户名
																	</td>
																	<td width="177" align="left">
																		<input style="width: 154px" name="j_username"
																			id="j_username" tabindex="1" value="" maxlength="15"
																			type="text" />
																	</td>
																</tr>
																<tr>
																	<td height="35" align="center" class="ziti-12-lanse">
																		密 码
																	</td>
																	<td width="177" align="left">
																		<input style="width: 154px" type="password"
																			name="j_password" id="j_password" value=""
																			tabindex="1" maxlength="15" />
																	</td>
																</tr>
															</table>
														</td>
														<td width="115" valign="top">
															<table width="115" border="0" cellspacing="0"
																cellpadding="0">
																<tr>
																	<td width="115" height="40">
																		&nbsp;
																	</td>
																</tr>
																<tr>
																	<td align="left">
																		<button type="submit"
																			style="width: 75px; height: 28px; margin: 0; padding: 0; background: transparent; border: 0;">
																			<img style="cursor: pointer;"
																				src="${ctx}/images/login-button.jpg" width="61"
																				height="28">
																		</button>
																	</td>
																</tr>
															</table>
														</td>
													</tr>
												</table>
											</td>
										</tr>
									</table>
								</td>
								<td width="79">
									&nbsp;
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td height="117" valign="top"
						background="${ctx}/images/login-footer.jpg">
						<table width="100%" border="0" cellspacing="0" cellpadding="5">
							<tr>
								<td height="28" align="right" class="baise">
									Jawa Open Source Group
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</form>
		<script>
	      <c:if test="${not empty param.error}">
		   alert('用户名或密码错!');  
		  </c:if>
	      function validateForm() {
		      if("" == document.getElementById("j_username").value){
 				alert("用户名不可以为空！");
 				document.getElementById("j_username").focus();
 				return false;
			  }                                                            
		      if("" == document.getElementById("j_password").value){
 				alert("用户密码不可以为空！");
 				document.getElementById("j_password").focus();
 				return false;
			  }                                                            
	          return true; 
	      } 
      	  document.getElementById("j_username").focus();
    </script>
	</body>
</html>
